public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();

        System.out.println("结点个数：" + binaryTree.size2(root));
        System.out.println("叶子结点个数：" + binaryTree.getLeafNodeCount1(root));
        System.out.println("叶子结点个数：" + binaryTree.getLeafNodeCount(root));
        System.out.println("第k层结点个数：" + binaryTree.getKLevelNodeCount(root, 2));
        System.out.println("二叉树的最大深度：" + binaryTree.maxDepth(root));
        System.out.print("递归前序遍历：");
        binaryTree.preOrder(root);
        System.out.println();
        System.out.print("非递归前序遍历：");
        binaryTree.preOrder(root);
        System.out.println();
        System.out.print("递归中序遍历：");
        binaryTree.inOrder(root);
        System.out.println();
        System.out.print("非递归中序遍历：");
        binaryTree.inOrderNor(root);
        System.out.println();
        System.out.print("递归后序遍历：");
        binaryTree.postOrder(root);
        System.out.println();
        System.out.print("非递归后序遍历：");
        binaryTree.postOrderNor(root);
        System.out.println();
        System.out.print("层序遍历：");
        binaryTree.levelOrder(root);
        System.out.println();
    }
}


